<%@ page contentType="text/html; charset=utf-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		
		<title>Pro Evolution Soccer Manager :: Login</title>
		
		<style type="text/css">
	        @import "js/dojo/dijit/themes/tundra/tundra.css";
	        @import "js/dojo/dojo/resources/dojo.css"
	        @import "css/estilos.css"
	    </style>
		 
		<script type="text/javascript" src="dwr/engine.js"> </script>
		<script type="text/javascript" src="dwr/util.js"> </script>
		
		<script type="text/javascript" src="dwr/interface/LoginDWR.js"> </script>
		
		<script type="text/javascript" src="js/dojo/dojo/dojo.js" djConfig="parseOnLoad: true"></script>
		  
		<script type="text/javascript"> 
			dojo.require("dijit.dijit");
       		dojo.require("dijit.form.Button");
       		dojo.require("dijit.form.TextBox");   
       		dojo.require("dijit.Tooltip");
       		dojo.require("dijit.form.Form");
    	</script>
		
		<script language="javascript">
			function validarDadosLogin() {
				dwr.engine.setErrorHandler(tratarErroLogin);
				
				var nomeUsuario = dwr.util.getValue("nomeUsuario");
				var senhaUsuario = dwr.util.getValue("senhaUsuario");
				var form = dijit.byId("loginForm");

				LoginDWR.validarDadosUsuario(nomeUsuario, senhaUsuario, {
					callback: function() {
						form.containerNode.submit();
					}
				});
			}

			function tratarErroLogin(mensagem, excecao) {
				alert(excecao.chave);
			}
		</script>
 
	</head>

	<body class="tundra">
		<div align="center">
			   
			<p><img src="img/banner.jpg" width="468" height="60" /></p>
			
			<form id="loginForm" method="post" action="login" dojoType="dijit.form.Form" >
			
				<p>&nbsp;</p>
				 
				<table width="380" border="0" cellspacing="0" cellpadding="0">
					<tr>  
						<td scope="col">
							<div align="right" class="style1">Nome de usuário:</div>
						</td>
						 
						<td scope="col">
							<div align="right">
								<input name="nomeUsuario" type="text" size="10" maxlength="10" 
									   dojoType="dijit.form.TextBox" trim="true" lowercase="true" required="true" />
							</div>
						</td>
					</tr>
					    
					<tr>
						<td>
							<div align="right" class="style1">Senha:</div>
						</td>
						<td>
							<div align="right">
								<input name="senhaUsuario" type="password" size="10" maxlength="8" 
									   dojoType="dijit.form.TextBox" trim="true" lowercase="true" required="true" />
							</div>
						</td>
					</tr>
					<tr>
						<td>&nbsp;</td> 
						<td>
							<div align="right"></div>
						</td>
					</tr>
					<tr>
						<td>&nbsp;</td>
						<td>
							<div align="right">
								<button dojoType="dijit.form.Button" id="entrar" onclick="validarDadosLogin();">Entrar</button>
								
								<div dojoType="dijit.Tooltip" style="display:none" connectId="entrar">
								    Clique aqui para entrar!
								</div>
							</div>
						</td>
					</tr>
					<tr>
						<td>&nbsp;</td>
						<td>
							<div align="right"></div>
						</td>
					</tr>
					<tr>
						<td colspan="2">
							<div align="center">Ainda não é cadastrado? Cadastre-se aqui</div>
						</td>
					</tr>
				</table>
				 
				<p>&nbsp;</p>
				
			</form>
			<table width="100%" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<th scope="col">&copy; 2009 Pro Evolution Soccer Manager - Todos os direitos reservados</th>
				</tr>
			</table>
		</div>
	
	</body>

</html>
